﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Text;
using System.Threading.Tasks;

namespace SimpleReactiveObjects
{
    /// <summary>
    /// Defines a message forwarder.
    /// </summary>
    /// <remarks>
    /// Messenger does not forward <see cref="IObserver{T}.OnCompleted()"/> and <see cref="IObserver{T}.OnError(Exception)"/>.
    /// </remarks>
    /// <typeparam name="T">The type of message object.</typeparam>
    public interface IReactiveMessenger<T> : IObservable<T>, IDisposable
    {
        /// <summary>
        /// Notifies all subscribed receivers with the message.
        /// </summary>
        /// <param name="message">The message.</param>
        void Raise(T message);
    }
}
